package 一维数组;
public class 去除 {
    public static void main(String[] args) {
        int lodArr[]={1,3,4,5,0,0,6,6,0,5,4,7,6,7,0,5};
        int s=0;
        for (int i =0; i<lodArr.length;i++){
            if (lodArr[i]==0) {
                s++;
            }
        }
        int [] newArr=new int[(lodArr.length-s)];
        int a=0;
            for (int j=0;j<lodArr.length;j++){
                if ( lodArr[j]!=0){
                    newArr[a]=lodArr[j];
                    System.out.println(newArr[a]);
                    a++;
                }
            }
    }
}
